﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.Runtime.Serialization;
using System.Data.Objects.DataClasses;

namespace FinalProject.DAL.Model
{


    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName = "InvoiceModel", Name = "Customer")]
    [Serializable()]
    [DataContractAttribute(IsReference = true)]
    public partial class Customer : EntityObject
    {
        #region Factory Method

        /// <summary>
        /// Create a new Customer object.
        /// </summary>
        /// <param name="id">Initial value of the Id property.</param>
        /// <param name="maxDebit">Initial value of the MaxDebit property.</param>
        /// <param name="code">Initial value of the Code property.</param>
        public static Customer CreateCustomer(global::System.Guid id, global::System.Decimal maxDebit, global::System.String code)
        {
            Customer customer = new Customer();
            customer.Id = id;
            customer.MaxDebit = maxDebit;
            customer.Code = code;
            return customer;
        }

        #endregion

        #region Primitive Properties

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty = true, IsNullable = false)]
        [DataMemberAttribute()]
        public global::System.Guid Id
        {
            get
            {
                return _Id;
            }
            set
            {
                if (_Id != value)
                {
                    OnIdChanging(value);
                    ReportPropertyChanging("Id");
                    _Id = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("Id");
                    OnIdChanged();
                }
            }
        }
        private global::System.Guid _Id;
        partial void OnIdChanging(global::System.Guid value);
        partial void OnIdChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
        [DataMemberAttribute()]
        public global::System.String Name
        {
            get
            {
                return _Name;
            }
            set
            {
                OnNameChanging(value);
                ReportPropertyChanging("Name");
                _Name = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("Name");
                OnNameChanged();
            }
        }
        private global::System.String _Name;
        partial void OnNameChanging(global::System.String value);
        partial void OnNameChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
        [DataMemberAttribute()]
        public global::System.String Address
        {
            get
            {
                return _Address;
            }
            set
            {
                OnAddressChanging(value);
                ReportPropertyChanging("Address");
                _Address = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("Address");
                OnAddressChanged();
            }
        }
        private global::System.String _Address;
        partial void OnAddressChanging(global::System.String value);
        partial void OnAddressChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
        [DataMemberAttribute()]
        public global::System.String IBAN
        {
            get
            {
                return _IBAN;
            }
            set
            {
                OnIBANChanging(value);
                ReportPropertyChanging("IBAN");
                _IBAN = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("IBAN");
                OnIBANChanged();
            }
        }
        private global::System.String _IBAN;
        partial void OnIBANChanging(global::System.String value);
        partial void OnIBANChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
        [DataMemberAttribute()]
        public global::System.String PhoneNumber
        {
            get
            {
                return _PhoneNumber;
            }
            set
            {
                OnPhoneNumberChanging(value);
                ReportPropertyChanging("PhoneNumber");
                _PhoneNumber = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("PhoneNumber");
                OnPhoneNumberChanged();
            }
        }
        private global::System.String _PhoneNumber;
        partial void OnPhoneNumberChanging(global::System.String value);
        partial void OnPhoneNumberChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
        [DataMemberAttribute()]
        public global::System.String FaxNumber
        {
            get
            {
                return _FaxNumber;
            }
            set
            {
                OnFaxNumberChanging(value);
                ReportPropertyChanging("FaxNumber");
                _FaxNumber = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("FaxNumber");
                OnFaxNumberChanged();
            }
        }
        private global::System.String _FaxNumber;
        partial void OnFaxNumberChanging(global::System.String value);
        partial void OnFaxNumberChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
        [DataMemberAttribute()]
        public global::System.String Delegate
        {
            get
            {
                return _Delegate;
            }
            set
            {
                OnDelegateChanging(value);
                ReportPropertyChanging("Delegate");
                _Delegate = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("Delegate");
                OnDelegateChanged();
            }
        }
        private global::System.String _Delegate;
        partial void OnDelegateChanging(global::System.String value);
        partial void OnDelegateChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = true)]
        [DataMemberAttribute()]
        public global::System.String TaxCode
        {
            get
            {
                return _TaxCode;
            }
            set
            {
                OnTaxCodeChanging(value);
                ReportPropertyChanging("TaxCode");
                _TaxCode = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("TaxCode");
                OnTaxCodeChanged();
            }
        }
        private global::System.String _TaxCode;
        partial void OnTaxCodeChanging(global::System.String value);
        partial void OnTaxCodeChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = false)]
        [DataMemberAttribute()]
        public global::System.Decimal MaxDebit
        {
            get
            {
                return _MaxDebit;
            }
            set
            {
                OnMaxDebitChanging(value);
                ReportPropertyChanging("MaxDebit");
                _MaxDebit = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("MaxDebit");
                OnMaxDebitChanged();
            }
        }
        private global::System.Decimal _MaxDebit;
        partial void OnMaxDebitChanging(global::System.Decimal value);
        partial void OnMaxDebitChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = false)]
        [DataMemberAttribute()]
        public global::System.String Code
        {
            get
            {
                return _Code;
            }
            set
            {
                OnCodeChanging(value);
                ReportPropertyChanging("Code");
                _Code = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Code");
                OnCodeChanged();
            }
        }
        private global::System.String _Code;
        partial void OnCodeChanging(global::System.String value);
        partial void OnCodeChanged();

        #endregion

        #region Navigation Properties

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("InvoiceModel", "CustomerOrderDocument", "OrderDocument")]
        public EntityCollection<OrderDocument> OrderDocuments
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<OrderDocument>("InvoiceModel.CustomerOrderDocument", "OrderDocument");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<OrderDocument>("InvoiceModel.CustomerOrderDocument", "OrderDocument", value);
                }
            }
        }

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("InvoiceModel", "CustomerDeliveryDocument", "DeliveryDocument")]
        public EntityCollection<DeliveryDocument> DeliveryDocuments
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<DeliveryDocument>("InvoiceModel.CustomerDeliveryDocument", "DeliveryDocument");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<DeliveryDocument>("InvoiceModel.CustomerDeliveryDocument", "DeliveryDocument", value);
                }
            }
        }

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("InvoiceModel", "CustomerInvoiceDocument", "InvoiceDocument")]
        public EntityCollection<InvoiceDocument> InvoiceDocuments
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<InvoiceDocument>("InvoiceModel.CustomerInvoiceDocument", "InvoiceDocument");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<InvoiceDocument>("InvoiceModel.CustomerInvoiceDocument", "InvoiceDocument", value);
                }
            }
        }

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("InvoiceModel", "CustomerVoucher", "Voucher")]
        public EntityCollection<Voucher> Vouchers
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<Voucher>("InvoiceModel.CustomerVoucher", "Voucher");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<Voucher>("InvoiceModel.CustomerVoucher", "Voucher", value);
                }
            }
        }

        #endregion

        #region Customize Methods

        #endregion
    }

}
